﻿function ServicePackageValid(name, description, currency, type)
        {
            var rName = new RegExp("[0-9a-zA-Z]");
            if (!rName.exec(name))
            {
                return 10;
            }
            else if (name.length > 50)
            {
                return 11;
            }

            var rCurrency = new RegExp("[0-9a-zA-Z]");
            if (!rCurrency.exec(currency))
            {
                return 20;
            }
            else if (currency.length > 50)
            {
                return 21;
            }

            var rType = new RegExp("[0-9a-zA-Z]");
            if (!rType.exec(type))
            {
                return 30;
            }
            else if (description.length > 2000)
            {
                return 40;
            }

            return 1;
        }